/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.menosehmais.business;

import br.com.caelum.vraptor.ioc.Component;
import br.com.menosehmais.dto.ServicoDeMarketingDTO;
import br.com.menosehmais.framework.business.CrudBusinessObject;
import br.com.menosehmais.model.ContratoDO;
import br.com.menosehmais.model.ServicoDeMarketingDO;
import br.com.menosehmais.persistence.ServicoDeMarketingDAO;
import java.util.List;

/**
 *
 * @author Rafael Quintino
 */
@Component
public class ServicoDeMarketingBO extends CrudBusinessObject<ServicoDeMarketingDO, ServicoDeMarketingDAO> {
    
    public ServicoDeMarketingBO( ServicoDeMarketingDAO dao ){
        super(dao);
    }

    public List<ServicoDeMarketingDO> listarTodosServicosMarketing() {
        List<ServicoDeMarketingDO> lista = dao.selectAll();
        return lista;
    }

    public List<ServicoDeMarketingDO> listarServicosMarketing(ContratoDO contratoDO) {
        ServicoDeMarketingDO servicoDO = new ServicoDeMarketingDO();
//        servicoDO.setContrato(contratoDO);
        List<ServicoDeMarketingDO> lista = dao.selectUsingFilter(servicoDO);
        return lista;
    }

     public List<ServicoDeMarketingDO> listarServicosMarketingFiltrados(ServicoDeMarketingDTO servicoDTO) {
        List<ServicoDeMarketingDO> lista = (List) dao.selectStringListByFieldLikeString("nome", "%"+servicoDTO.getFiltroNome()+"%", true, 0, 30);
        return lista;
    }

}
